package com.zzyl.nursing.service;

import com.baomidou.mybatisplus.extension.service.IService;
import com.zzyl.common.core.page.TableDataInfo;
import com.zzyl.nursing.domain.Reservation;
import com.zzyl.nursing.vo.TimeCountVo;

import java.util.List;

/**
 * 预约信息Service接口
 *
 * @author success
 * @date 2025-01-15
 */
public interface IReservationService extends IService<Reservation> {

    /**
     * 查询取消预约数量
     *
     * @param userId
     * @return
     */
    int getCancelledReservationCount(Long userId);

    /**
     * 查询每个小时段剩余预约次数
     *
     * @param time
     * @return
     */
    List<TimeCountVo> countReservationsForTime(Long time);

    /**
     * 插入预约信息
     *
     * @param reservation
     * @return
     */
    int insertReservation(Reservation reservation);

    /**
     * 分页查询预约信息
     *
     * @param
     * @return
     */
    TableDataInfo<Reservation> pageQueryReservation(Integer pageNum, Integer pageSize, Integer status);

    /**
     * 删除预约信息
     *
     * @param id
     * @return
     */
    int cancelReservation(Long id);

    /**
     * 定时更新过期预约的状态
     */
    void updateReservationStatus();
}
